<template>
  <div>
    <head-tab />
    <div class="form-container">
      <el-form :model="formData"
               ref="formData"
               label-width="120px">
        <el-form-item label="权限标识：">
          <span v-if="isEdit === '1'">{{formData.permission || '无'}}</span>
          <el-input v-if="isEdit === '0'"
                    v-model="formData.permission"
                    placeholder="请输入权限标识"></el-input>
        </el-form-item>
        <el-form-item label="角色名称：">
          <span v-if="isEdit === '1'">{{formData.role_name || '无'}}</span>
          <el-input v-if="isEdit === '0'"
                    v-model="formData.role_name"
                    placeholder="请输入角色名称"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="success"
                     v-if="isEdit === '0'"
                     @click="submit">提交</el-button>
          <el-button type="info"
                     @click="back">返回</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
import { parseTime } from '@/utils/index'
import headTab from '../headTab.vue'
export default {
  components: { headTab },
  name: 'UserForm',
  data() {
    return {
      formData: {},
      isEdit: this.$route.query.isEdit
    }
  },
  created() {
  },
  methods: {
    parseTime,
    submit() {

    },
    back() {
      this.$router.push({
        path: '/',
        query: { activeName: this.$route.query.activeName }
      })
    }
  },
}
</script>

<style lang="scss" scoped>
</style>